﻿using System;
using System.Globalization;
using System.Windows.Data;
using SuppKids.Resources;

namespace SuppKids.Converters
{
    public class DateConverter:IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            if (value is DateTime)
            {
                var dateTime = (DateTime) value;
                return dateTime.ToString(Common.DateFormat);
            }

            return value == null ? string.Empty : value.ToString();
        }

        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }
}